<?php
# http://projects:8081/cdapp-2kt-api/api/seat_hours_daysum.php

include_once '_portal.php';

$start_date = isset($_GET["start_date"]) ? $_GET["start_date"] : date("Y-m-d");
$end_date = isset($_GET["end_date"]) ? $_GET["end_date"] : date("Y-m-d");
// $with_details = isset($_GET["with_details"]) ? $_GET["with_details"] : 0;

$sql = "SELECT * FROM `2kt_seat_hours` WHERE `startTime` <= '{$end_date}' AND `endTime` >= '{$start_date}'";

$details = exec_sql($sql);

$users = get_param('ATCOSUsers');

output(['users' => $users, 'details' => $details]);